package com.xbongbong.saas.domain.dao;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.saas.domain.entity.OtherExpenseEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface OtherExpenseDao {
    Integer insert(OtherExpenseEntity entity);

    void insertBatch(List<OtherExpenseEntity> list);

    OtherExpenseEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer update(OtherExpenseEntity entity);

    List<OtherExpenseEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);
    /**
     * 更新下更新时间
     * @param updateTime
     * @param id
     * @param corpid
     * @return
     */
    Integer updateTime(@Param("updateTime") Long updateTime, @Param("id") Long id, @Param("corpid") String corpid);
    /**
     * 批量更新
     * @param updateList 供应商id列表
     * @param corpid 公司id
     * @return
     * @throws XbbException
     */
    Integer updateBatch(@Param("list") List<UpdateDataEntity> updateList, @Param("corpid") String corpid);

    void deleteBatch(@Param("ids") List<Long> ids, @Param("corpid") String corpid);

    void insertBatchCK(@Param("list")List<OtherExpenseEntity> list);
}
